package com.wayne.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
import com.wayne.model.IndexRequest;

/**
 * Created by shitou on 17/4/16.
 */
@Controller
@RequestMapping("index")
public class IndexController {


    @ResponseBody
    @RequestMapping(value = "/**", method = RequestMethod.POST)
    public void index(HttpServletRequest request,HttpServletResponse response2) throws IOException {
        response2.setContentType("text/plain");
        response2.setCharacterEncoding("utf-8");
        final PrintWriter writer = response2.getWriter();
        writer.write("OK,NISHI DUIDE");
        writer.flush();
        writer.close();
        //return "OK,NISHI DUIDE2 ";
    }
    @ResponseBody
    @RequestMapping(value = "/checkquest", method = RequestMethod.POST)
    public void  checkquest(IndexRequest request){

        if(request.getName()!=null){

        }
        String name=request.getName();
        if (name!=null&&name.length()>0){
            String dsd="";
        }
        String sex=request.getSex();
    }
}
